package com.wali.modules.bil.bo;

import com.wali.common.ccp.execl.annotation.CcpExcelField;
import com.wali.modules.bil.vo.BilExpressVO;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author walixu
 * @ClassName com.wali.modules.common.vo
 * @Description 运单信息BO类
 * @email wali.xu@kpmg.com
 * @date 20/01/2019 2:14 下午
 */
public class BilExpressBO implements Serializable {

    /**
     * 主键
     */
    private int id;

    /**
     * 运单号
     */
    @CcpExcelField(title = "运单号")
    private String waybillNo;

    /**
     * 用户ID
     */
    private int userId;

    /**
     * 发货仓库仓库
     */
    private String storeCode;

    /**
     * 发货仓库名称
     */
    private String storeName;

    /**
     * 渠道
     */
    private String channelCode;

    /**
     * 渠道名称
     */
    private String channelName;

    /**
     * 收件人
     */
    private int receiverId;

    /**
     * 收件人名称
     */
    private String receiverName;

    /**
     * 收件人身份证号
     */
    private String idCard;

    /**
     * 发件人
     */
    private int senderId;

    /**
     * 发件人账号
     */
    private String username;

    /**
     * 总费用
     */
    private double total = 0;

    /**
     * 总费用
     */
    private String totalUnit = "cad";

    /**
     * 价值
     */
    private double value;

    /**
     * 税费
     */
    private double tax;

    /**
     * 保价
     */
    private double insurance;

    /**
     * 保费
     */
    private double premium;

    /**
     * 增值服务费
     */
    private double gprs;

    /**
     * 预估重量
     */
    private double accessWeight;

    /**
     * 称重重量
     */
    private double trueWeight;

    /**
     * 计费重量
     */
    private double chargeWeight = 0;

    /**
     * 计费重量单位
     */
    private String chargeWeightUnit = "kg";

    /**
     * 运单当前状态
     */
    private int state;

    /**
     * 运单当前状态描述
     */
    private String stateDescription;

    /**
     * 业务操作方式
     */
    private int operate;

    /**
     * 快递号
     */
    @CcpExcelField(title = "快递号")
    private String expressNo;

    /**
     * 备注
     */
    private String description;

    /**
     * 创建时间
     */
    private String createTime;

    /**
     * 更新时间
     */
    private String updateTime;

    /**
     * 开始日期
     */
    private String startDate;

    /**
     * 结束日期
     */
    private String endDate;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getWaybillNo() {
        return waybillNo;
    }

    public void setWaybillNo(String waybillNo) {
        this.waybillNo = waybillNo;
    }

    public String getTotalUnit() {
        return totalUnit;
    }

    public void setTotalUnit(String totalUnit) {
        this.totalUnit = totalUnit;
    }

    public String getChargeWeightUnit() {
        return chargeWeightUnit;
    }

    public void setChargeWeightUnit(String chargeWeightUnit) {
        this.chargeWeightUnit = chargeWeightUnit;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getStoreCode() {
        return storeCode;
    }

    public void setStoreCode(String storeCode) {
        this.storeCode = storeCode;
    }

    public String getChannelCode() {
        return channelCode;
    }

    public void setChannelCode(String channelCode) {
        this.channelCode = channelCode;
    }

    public int getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(int receiverId) {
        this.receiverId = receiverId;
    }

    public int getSenderId() {
        return senderId;
    }

    public void setSenderId(int senderId) {
        this.senderId = senderId;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public double getValue() {
        return value;
    }

    public void setValue(double value) {
        this.value = value;
    }

    public double getTax() {
        return tax;
    }

    public void setTax(double tax) {
        this.tax = tax;
    }

    public double getInsurance() {
        return insurance;
    }

    public void setInsurance(double insurance) {
        this.insurance = insurance;
    }

    public double getPremium() {
        return premium;
    }

    public void setPremium(double premium) {
        this.premium = premium;
    }

    public double getGprs() {
        return gprs;
    }

    public void setGprs(double gprs) {
        this.gprs = gprs;
    }

    public double getAccessWeight() {
        return accessWeight;
    }

    public void setAccessWeight(double accessWeight) {
        this.accessWeight = accessWeight;
    }

    public double getTrueWeight() {
        return trueWeight;
    }

    public void setTrueWeight(double trueWeight) {
        this.trueWeight = trueWeight;
    }

    public double getChargeWeight() {
        return chargeWeight;
    }

    public void setChargeWeight(double chargeWeight) {
        this.chargeWeight = chargeWeight;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateDescription() {
        return stateDescription;
    }

    public void setStateDescription(String stateDescription) {
        this.stateDescription = stateDescription;
    }

    public int getOperate() {
        return operate;
    }

    public void setOperate(int operate) {
        this.operate = operate;
    }

    public String getExpressNo() {
        return expressNo;
    }

    public void setExpressNo(String expressNo) {
        this.expressNo = expressNo;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BilExpressBO that = (BilExpressBO) o;
        return id == that.id &&
                userId == that.userId &&
                receiverId == that.receiverId &&
                senderId == that.senderId &&
                Double.compare(that.total, total) == 0 &&
                Double.compare(that.value, value) == 0 &&
                Double.compare(that.tax, tax) == 0 &&
                Double.compare(that.insurance, insurance) == 0 &&
                Double.compare(that.premium, premium) == 0 &&
                Double.compare(that.gprs, gprs) == 0 &&
                Double.compare(that.accessWeight, accessWeight) == 0 &&
                Double.compare(that.trueWeight, trueWeight) == 0 &&
                Double.compare(that.chargeWeight, chargeWeight) == 0 &&
                state == that.state &&
                operate == that.operate &&
                Objects.equals(waybillNo, that.waybillNo) &&
                Objects.equals(storeCode, that.storeCode) &&
                Objects.equals(storeName, that.storeName) &&
                Objects.equals(channelCode, that.channelCode) &&
                Objects.equals(channelName, that.channelName) &&
                Objects.equals(receiverName, that.receiverName) &&
                Objects.equals(idCard, that.idCard) &&
                Objects.equals(stateDescription, that.stateDescription) &&
                Objects.equals(expressNo, that.expressNo) &&
                Objects.equals(description, that.description) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(startDate, that.startDate) &&
                Objects.equals(endDate, that.endDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, waybillNo, userId, storeCode, storeName, channelCode, channelName, receiverId, receiverName, idCard, senderId, total, value, tax, insurance, premium, gprs, accessWeight, trueWeight, chargeWeight, state, stateDescription, operate, expressNo, description, createTime, updateTime, startDate, endDate);
    }

    @Override
    public String toString() {
        return "BilExpressBO{" +
                "id=" + id +
                ", waybillNo='" + waybillNo + '\'' +
                ", userId=" + userId +
                ", storeCode='" + storeCode + '\'' +
                ", storeName='" + storeName + '\'' +
                ", channelCode='" + channelCode + '\'' +
                ", channelName='" + channelName + '\'' +
                ", receiverId=" + receiverId +
                ", receiverName='" + receiverName + '\'' +
                ", idCard='" + idCard + '\'' +
                ", senderId=" + senderId +
                ", total=" + total +
                ", value=" + value +
                ", tax=" + tax +
                ", insurance=" + insurance +
                ", premium=" + premium +
                ", gprs=" + gprs +
                ", accessWeight=" + accessWeight +
                ", trueWeight=" + trueWeight +
                ", chargeWeight=" + chargeWeight +
                ", state=" + state +
                ", stateDescription='" + stateDescription + '\'' +
                ", operate=" + operate +
                ", expressNo='" + expressNo + '\'' +
                ", description='" + description + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", startDate='" + startDate + '\'' +
                ", endDate='" + endDate + '\'' +
                '}';
    }

    /**
     * @param
     * @return
     * @throws
     * @Title convert
     * @Description 将BilExpressBO转换为BilExpressVO
     */
    public static BilExpressVO convert(BilExpressBO bilExpressBO) {
        BilExpressVO temp = new BilExpressVO();
        temp.setAccessWeight(bilExpressBO.getAccessWeight());
        temp.setChannelCode(bilExpressBO.getChannelCode());
        temp.setChannelName(bilExpressBO.getChannelName());
        temp.setChargeWeight(bilExpressBO.getChargeWeight());
        temp.setChargeWeightUnit(bilExpressBO.getChargeWeightUnit());
        temp.setCreateTime(bilExpressBO.getCreateTime());
        temp.setDescription(bilExpressBO.getDescription());
        temp.setEndDate(bilExpressBO.getEndDate());
        temp.setExpressNo(bilExpressBO.getExpressNo());
        temp.setGprs(bilExpressBO.getGprs());
        temp.setId(bilExpressBO.getId());
        temp.setInsurance(bilExpressBO.getInsurance());
        temp.setOperate(bilExpressBO.getOperate());
        temp.setPremium(bilExpressBO.getPremium());
        temp.setReceiverId(bilExpressBO.getReceiverId());
        temp.setReceiverName(bilExpressBO.getReceiverName());
        temp.setIdCard(bilExpressBO.getIdCard());
        temp.setStartDate(bilExpressBO.getStartDate());
        temp.setState(bilExpressBO.getState());
        temp.setStateDescription(bilExpressBO.getStateDescription());
        temp.setStoreCode(bilExpressBO.getStoreCode());
        temp.setStoreName(bilExpressBO.getStoreName());
        temp.setTax(bilExpressBO.getTax());
        temp.setTotal(bilExpressBO.getTotal());
        temp.setTotalUnit(bilExpressBO.getTotalUnit());
        temp.setTrueWeight(bilExpressBO.getTrueWeight());
        temp.setUpdateTime(bilExpressBO.getUpdateTime());
        temp.setUserId(bilExpressBO.getUserId());
        temp.setUsername(bilExpressBO.getUsername());
        temp.setValue(bilExpressBO.getValue());
        temp.setWaybillNo(bilExpressBO.getWaybillNo());
        return temp;
    }

}
